<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Opreating System</title>
</head>
<body>
	<div align="center">
		<h1>Opreating System</h1>
		<a href="zhuce.html">注册</a>
		<a href="denglu.html">登录</a>
	</div>
	
	<?php
	$con = @mysql_connect("localhost","root","");

	if (!$con)
	{
		die('Could not connect: ' . mysql_error());
	}

	if (!$con)
	{
		die('Could not connect: ' . mysql_error());
	}

	// Create database
	if (mysql_query("CREATE DATABASE data",$con))
	{
		echo "Database created";
	}

	// Create table in my_db database
	mysql_select_db("data", $con);
	$sql = "CREATE TABLE userinfo 
	(
	username varchar(15),
	userpass varchar(15),
	usertype varchar(15)
	)";
	mysql_query($sql,$con);

	$sql = "CREATE TABLE homework_assignment 
	(
	h_name varchar(30)
	)";
	mysql_query($sql,$con);

	$sql = "CREATE TABLE homework_submit 
	(
	h_comment varchar(30),
	h_mark varchar(30),
	h_name varchar(30)
	)";
	mysql_query($sql,$con);

	mysql_close($con);
	?>
	</body>
	</html>